package com.allwees.bs.module.core.dynamic.model;

import com.allwees.bs.core.model.order.entity.SkuSnapModel;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 商品快照
 *
 * @author mouhainning
 * @since 2020-3-9 14:14
 */
@Data
public class ProductSnap implements Serializable {

    /** uuid **/
    private String uuid;

    /** no **/
    private String no;

    /** 商品名称 **/
    private String name;

    /** 商品图片 **/
    private String photo;

    /** 商品描述 **/
    private String description;

    /** 快递价格 **/
    private BigDecimal shippingPrice;

    /** 快递价格币种 **/
    private String shippingCurrency;

    /** 快递预计到达时间 **/
    private String shippingArrivalDesc;

    /** 类别全名 **/
    private String categoryFullname;

    private Boolean isFeeGiftProd;

    public ProductSnap(SkuSnapModel skuSnap) {
        this.setUuid(skuSnap.getProductUuid());
        this.setNo(skuSnap.getProductNo());
        this.setName(skuSnap.getProductName());
        this.setPhoto(skuSnap.getProductPhoto());
        this.setDescription(skuSnap.getProductDesc());
        this.setShippingPrice(skuSnap.getSkuShippingPrice());
        this.setShippingCurrency(skuSnap.getSkuShippingCurrency());
        this.setShippingArrivalDesc(skuSnap.getProductShippingArrivalDesc());
        this.setIsFeeGiftProd(skuSnap.getFreeGiftProd());
    }

    public ProductSnap(String categoryFullname, SkuSnapModel skuSnap) {
        this(skuSnap);
        this.setCategoryFullname(categoryFullname);
    }
}
